<?php

namespace Home\Controller;

use Think\Controller;

class MapController extends Controller {

    public function index() {
         $model = M('buildinglocation');
        $condition['PublicCodeID'] = 1;
        $form = $model->where($condition)->find();
        $this->assign('vo', $form);
        $this->display("map");
    }
    
    public function SetBuildingPoint(){
        $Lat = I('Lat', '', "htmlspecialchars");
        $Lon=I('Lon','',"htmlspecialchars");
        $BuildingName=I('BuildingName','','htmlspecialchars');
        $BuildingAddress=I('BuildingAddress','','htmlspecialchars');
        $model = M('buildinglocation');
        $data['Latitude'] = $Lat;
        $data['Longitude']=$Lon;
        $data['BuildingName']=$BuildingName;
        $data['BuildingAddress']=$BuildingAddress;
        $result = $model->where('id=1')->save($data);
        if ($result) {
            $this->ajaxReturn('y','EVAL');
        }
        else{
            $this->ajaxReturn('n','EVAL');
        }
        
    }
    public function SetBaiduMap(){
        
       
    }

  

}
